package cn.edu.hnu.gpg.service;

import cn.edu.hnu.gpg.dao.DepartmentMapper;
import cn.edu.hnu.gpg.entity.Department;
import cn.edu.hnu.gpg.entity.DepartmentExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartmentServiceImpl implements DepartmentService {

    private final DepartmentMapper departmentMapper;

    @Autowired
    public DepartmentServiceImpl(DepartmentMapper departmentMapper) {
        this.departmentMapper = departmentMapper;
    }

    @Override
    public List<Department> listDepartments() {
        return departmentMapper.selectByExample(new DepartmentExample());
    }
}
